import sys
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QFormLayout,QLineEdit

def init_Widget(w:QWidget):
    w.setWindowTitle("布局")
    w.resize(640,480)

    layout = QFormLayout(w)
    
    layout.addRow("姓名:",QLineEdit())
    layout.addRow("电话:",QLineEdit())
    layout.addRow("年纪:",QLineEdit())
    layout.addRow(QPushButton("提交"))

if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = QWidget()
    init_Widget(w)
    w.show()
    sys.exit(app.exec_())
    
    